<template>
  <div class="login-container">
    <div class="logo">
      <img src="./../assets/logo.png" alt="Logo" />
      <h1>GitHub</h1>
    </div>
    <p class="description">全球最大的代码托管平台</p>
    <div class="tabs">
      <button :class="{ active: activeTab === 'account' }" @click="activeTab = 'account'">账号密码登录</button>
      <button :class="{ active: activeTab === 'phone' }" @click="activeTab = 'phone'">手机号验证码登录</button>
    </div>
    <div v-if="activeTab === 'account'">
      <div class="input-group">
        <input type="text" placeholder="用户名:user" />
      </div>
      <div class="input-group">
        <input type="password" placeholder="密码:user" />
      </div>
    </div>
    <div v-if="activeTab === 'phone'">
      <div class="input-group">
        <input type="text" placeholder="手机号:" />
      </div>
      <div class="input-group">
        <input type="text" placeholder="验证码" />
        <button class="code-btn">获取验证码</button>
      </div>
    </div>
    <div class="options">
      <label>
        <input type="checkbox" />
        自动登录
      </label>
      <a href="#" class="forgot-password">忘记密码</a>
    </div>
    <button class="login-btn">登录</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeTab: 'account',
    };
  },
};
</script>

<style scoped>
.login-container {
  width: 400px; /* 增加宽度以适应样式 */
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  background: white; /* 背景颜色为白色以匹配样式 */
  border-radius: 8px; /* 圆角 */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 增加阴影 */
}

.logo img {
  width: 120px; /* 增大logo */
}

.logo h1 {
  font-size: 24px; /* 调整标题字体大小 */
  font-weight: bold;
  color: #333;
}

.description {
  font-size: 14px; /* 描述文字大小 */
  color: #666;
  margin: 10px 0;
}

.tabs {
  margin: 20px 0;
}

.tabs button {
  background: none;
  border: none;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  padding: 10px 20px; /* 按钮内边距 */
  transition: color 0.3s;
}

.tabs .active {
  color: #007bff;
  border-bottom: 2px solid #007bff; /* 为激活按钮添加底部边框 */
}

.input-group {
  margin: 10px 0;
}

.input-group input {
  width: 80%;
  padding: 12px; /* 调整输入框内边距 */
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.3s;
}

.input-group input:focus {
  border-color: #007bff; /* 聚焦时边框颜色改变 */
}

.options {
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center; /* 对齐选项 */
}

.forgot-password {
  color: #007bff; /* 设置忘记密码链接颜色 */
  text-decoration: none;
  font-size: 14px; /* 调整字体大小 */
}

.code-btn {
  width: 40%;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 13px; /* 增加顶部边距 */
  margin-left: 5px; /* 添加左边距 */
  transition: background-color 0.3s;
}

.code-btn:hover {
  background-color: #0056b3; /* 悬停时背景颜色变化 */
}

.login-btn {
  width: 85%;
  margin-top: 20px; /* 增加顶部边距 */
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px 15px; /* 调整按钮内边距 */
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.login-btn:hover {
  background-color: #0056b3; /* 悬停时背景颜色变化 */
}
</style>
